/*
 * Copyright (c) 2021. Moses All Right Reserved
 */

package com.moses.design_patterns.strategy;

/**
 * @author Moses
 * @email shenhuohui@gmail.com
 * @date 2021/4/15 22:48
 */
public class Client {
    public static void main(String[] args) {
        // 采用了面向对象的继承和多态机制
        Context context1 = new Context(new Strategy1());
        context1.run();

        Context context2 = new Context(new Strategy2());
        context2.run();

        Context context3 = new Context(new Strategy3());
        context3.run();

        //枚举策略
        EnumStrategy.Method1.exec();
        EnumStrategy.Method2.exec();
    }
}
